home *** CD-ROM | disk | FTP | other *** search
- #ifndef __APPLICATION__
- #define __APPLICATION__
-
- class TAbstractDocument;
- class TFSSpecification;
-
- //
- // For class definition of TAbstractScriptableObject,
- // needed as base class of TApplication
- //
- #include "AbstractScriptableObject.h"
-
- //
- // For class definition of TFSSpecification, needed
- // as a field of TApplication
- //
- #include "FSSpecification.h"
-
- //
- // For definition of Int64, used as a parameter of
- // methods of TApplication
- //
- #include "Int64.h"
-
- #define clApplication 10
-
- //================================================================================
- // Class TApplication
- //================================================================================
- class TApplication : public TAbstractScriptableObject
- {
- private:
- TApplication();
-
- public:
- DeclareClassData(TApplication, TAbstractScriptableObject);
-
- static TApplication* Instance() { if(gApplication == nil) gApplication = new TApplication; return gApplication; }
-
- virtual DescType ObjectClass(const TAETransaction& t, Boolean recordedClass = false);
- virtual Boolean DerivedFromOSLClass(const TAETransaction& t, DescType objectClass);
-
- virtual TAbstractObjectIterator* ElementIterator(const TAETransaction& t);
- // virtual long CountElements(DescType classToCount = typeWildCard);
- // virtual TAbstractScriptableObject* AccessByIndex(DescType desiredClass, long index);
- virtual TAbstractScriptableObject* AccessByUniqueID(const TAETransaction& t, DescType desiredClass, TDescriptor uniqueID);
-
- virtual TDescriptor GetProperty(const TAETransaction& t, DescType propertyName, DescType desiredType, unsigned long additionalInfo = 0);
- virtual void SetProperty(const TAETransaction& t, DescType propertyName, TDescriptor& data, unsigned long additionalInfo = 0);
-
- virtual TDescriptor AECommand(const TAETransaction& t, long aeCommandID, TAbstractScriptableObject* auxObjects = nil, long auxInfo = 0);
- virtual TAbstractScriptableObject* CreateNewElement(const TAETransaction& t, DescType newObjectClass, TDescriptor initialData, TDescriptor initialProperties, Boolean& usedInitialData, Boolean& usedInitialProperties);
-
- TAbstractDocument* FindDocument(Int64, Boolean searchForAndOpen = false);
- TAbstractDocument* FindDocument(TFSSpecification& fileSpec, Boolean openDocument = false);
-
- long DocumentIndex(Int64 documentID);
-
- void Idle();
- void MarkForClose(TAbstractDocument* doc);
- void ProcessCloseRequest();
- void TearDownApplication();
-
- void SetResolutionMode(long newValue);
-
- long AppFileVRefNum() { return fFileSpec.VRefNum(); }
-
- private:
- Boolean fCloseRequestsPending;
- long fResolutionMode;
- ProcessSerialNumber fPSN;
- TFSSpecification fFileSpec;
-
- static TApplication* gApplication;
- };
-
- #endif
-